<template>
	<view v-show="base && userInfo">
		<view style="width: 100%;height: 100vh;background-size:100% 100%;display: flex;align-items: center;justify-content: center;" :style="{'backgroundImage': 'url('+base.red_bg_image+')'}">
			
			<u-image :src="base.logo_image"
			width="60vw" 
			mode="widthFix"
			style="position: absolute;z-index: 0;top:5vw;"
			></u-image>
			
			<view class="white u-font-12" style="position: absolute;z-index: 0;bottom:5vw;">
				{{base.copyright}} 
			</view>
		
				<!-- 添加提示图片和按钮图片 -->
				<view style="width: 70%; display: flex; flex-direction: column; align-items: center;">
					<u-image :src="base.indextipimage" 
						width="100%" 
						mode="widthFix"
						style="margin-bottom: 15px;"
					></u-image>
					
					<u-image :src="base.indexbtnimage" 
						width="100%" 
						mode="widthFix"
						@click="open"
					></u-image>
				</view>
				
		

		</view>
		
	</view>

</template>

<script>
	export default {
		data() {
			return {
				randcode:'',
				show:false,
				show_rule:false,
				animation:{},
				animationData: {},
				result:''
			}
		},
		computed: {
			
		},
		onLoad(option) {
			console.log('option: ',option);
			this.randcode=option.randcode
			// console.log('randcode: ',this.randcode);
			
			// 小程序
			// #ifdef MP-WEIXIN
			this.miniloading()
			// #endif

			// H5
			// #ifdef H5
			this.h5loading();
			// #endif
		},
		methods: {
			async open(){
				// 调用扫一扫功能
				this.$u.wx.scanQRCode((res) => {
					// 获取扫码结果
					console.log('扫码结果:', res);
					// 跳转到detail页面并传递扫码参数
					uni.navigateTo({
						url: '/pages/detail/detail?randcode=' + encodeURIComponent(res.resultStr)
					});
				});
			},
			async h5loading() {

				var that = this;
				this.$u.func.base(res => {
					// 处理获取基础信息后的内容

					uni.setNavigationBarTitle({
						title: res.title
					});


					that.$u.func.getuserinfo(res => {
						// 处理获取用户信息后的函数

					});


					that.$u.wx.noshare()


				});



			},
			async miniloading() {
				// var data=await this.$u.api.index();
				// console.log(data)
			},
			async minilogin() {
				var data = await this.$u.api.get('index/banner');
				console.log(data)
			}
		}
	}
</script>

<style>
	.warp {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;
	}
	/*base code*/
	.animated {
	  -webkit-animation-duration: 0.8s;
	  animation-duration: 0.8s;
	  -webkit-animation-fill-mode: both;
	  animation-fill-mode: both;
	}
	.animated.infinite {
	  -webkit-animation-iteration-count: infinite;
	  animation-iteration-count: infinite;
	}
	.animated.hinge {
	  -webkit-animation-duration: 1s;
	  animation-duration: 1s;
	}

	@keyframes pulse {
	  0% {
	    -webkit-transform: scale3d(1, 1, 1);
	    -ms-transform: scale3d(1, 1, 1);
	    transform: scale3d(1, 1, 1)
	  }
	  50% {
	    -webkit-transform: scale3d(1.1, 1.1, 1.1);
	    -ms-transform: scale3d(1.1, 1.1, 1.1);
	    transform: scale3d(1.1, 1.1, 1.1)
	  }
	  100% {
	    -webkit-transform: scale3d(1, 1, 1);
	    -ms-transform: scale3d(1, 1, 1);
	    transform: scale3d(1, 1, 1)
	  }
	}
	.pulse {
	  -webkit-animation-name: pulse;
	  animation-name: pulse
	}

</style>